package com.ruoyi.hospital.service.shop.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.hospital.mapper.shop.ShopProductAttributesMapper;
import com.ruoyi.hospital.domain.shop.ShopProductAttributes;
import com.ruoyi.hospital.service.shop.IShopProductAttributesService;

/**
 * 商品属性Service业务层处理
 * 
 * @author ruoyi
 * @date 2024-08-17
 */
@Service
public class ShopProductAttributesServiceImpl implements IShopProductAttributesService 
{
    @Autowired
    private ShopProductAttributesMapper shopProductAttributesMapper;

    /**
     * 查询商品属性
     * 
     * @param id 商品属性主键
     * @return 商品属性
     */
    @Override
    public ShopProductAttributes selectShopProductAttributesById(Integer id)
    {
        return shopProductAttributesMapper.selectShopProductAttributesById(id);
    }

    /**
     * 查询商品属性列表
     * 
     * @param shopProductAttributes 商品属性
     * @return 商品属性
     */
    @Override
    public List<ShopProductAttributes> selectShopProductAttributesList(ShopProductAttributes shopProductAttributes)
    {
        return shopProductAttributesMapper.selectShopProductAttributesList(shopProductAttributes);
    }

    /**
     * 新增商品属性
     * 
     * @param shopProductAttributes 商品属性
     * @return 结果
     */
    @Override
    public int insertShopProductAttributes(ShopProductAttributes shopProductAttributes)
    {
        shopProductAttributes.setCreateTime(DateUtils.getNowTimeSecond());
        return shopProductAttributesMapper.insertShopProductAttributes(shopProductAttributes);
    }

    /**
     * 修改商品属性
     * 
     * @param shopProductAttributes 商品属性
     * @return 结果
     */
    @Override
    public int updateShopProductAttributes(ShopProductAttributes shopProductAttributes)
    {
        shopProductAttributes.setUpdateTime(DateUtils.getNowTimeSecond());
        return shopProductAttributesMapper.updateShopProductAttributes(shopProductAttributes);
    }

    /**
     * 批量删除商品属性
     * 
     * @param ids 需要删除的商品属性主键
     * @return 结果
     */
    @Override
    public int deleteShopProductAttributesByIds(Integer[] ids)
    {
        return shopProductAttributesMapper.deleteShopProductAttributesByIds(ids);
    }

    /**
     * 删除商品属性信息
     * 
     * @param id 商品属性主键
     * @return 结果
     */
    @Override
    public int deleteShopProductAttributesById(Integer id)
    {
        return shopProductAttributesMapper.deleteShopProductAttributesById(id);
    }
}
